<?php 
if($_POST){
	function checkImg($file){
		$arr = array("gif","jpg","png","bmp","jpeg");
		$re = strrchr($file,'.');
		$re = ltrim($re,'.');
		if(in_array($re,$arr)){
			return true;
		}else{
			return false;
		}
	}
	$bool = checkImg($_POST['pics']);
}
 ?>
<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<title>Document</title>
	<style type="text/css">
		body{
			background: gainsboro;
		}
		div{
			background: url(img/1.gif) no-repeat 0px 0px;
			margin: 100px auto;
			width: 1000px;
			height: 600px;
		}
		div form{
			width: 300px;
			color: darkgrey;
			margin: 0 300px;
			text-align: center;
			padding-top: 200px;
			font-size: 50px;
		}
		input:nth-of-type(1){
			height: 30px;
			width: 200px;
		}
		input:nth-of-type(2){
			height: 34px;
		}
		div h2{
			font-family: "微软雅黑";
			color: yellow;
			height: 100px;
			line-height: 100px;
			margin: 0 350px;
			font-size: 50px;
		}
	</style>
</head>
<body>
	<div>
	 	<form action="" method="post">
	 		<input type="text" name="pics" id="" placeholder="请输入文件名"/>
	 		<input type="submit" value="enter"/>
	 	</form>
	 	<h2><?php  echo isset($bool)? ($bool==1 ? 'true' : 'false') : '' ?></h2>	
 	</div>
</body>
</html>